package com.a1anwang.okble.server.core;

import java.util.HashMap;

/**
 * Created by a1anwang.com on 2018/5/24.
 */
public class OKBLEServerOperationFailedDescUtils {
    private static HashMap<Integer, String> descArray = new HashMap<>();

    static {
        descArray.put(OKBLEServerOperation.BLEServerOperationListener.Operation_FAILED_Invalid_Service_UUID, "Service UUID is invalid");
        descArray.put(OKBLEServerOperation.BLEServerOperationListener.Operation_FAILED_Invalid_Characteristic_UUID, "Characteristic UUID is invalid");
        descArray.put(OKBLEServerOperation.BLEServerOperationListener.Operation_FAILED_BLE_Failed, "BLE_Failed");
    }

    /**
     * 获取Desc
     *
     * @param errCode 错误代码
     * @return string
     */
    public static String getDesc(int errCode) {

        return descArray.getOrDefault(errCode, "unknown error");
    }
}
